Package gwtappcontainer.testhelpers

Source Code of gwtappcontainer.testhelpers.UtilTest

package gwtappcontainer.testhelpers;

import static org.junit.Assert.assertTrue;
import gwtappcontainer.shared.apis.admin.RoleProp;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class UtilTest {
 
  @Test
  public void testIsRolePresent() {
    RoleProp prop1 = new RoleProp();
    prop1.name = "role1";
   
    RoleProp prop2 = new RoleProp();
    prop2.name = "role2";
   
    RoleProp prop3 = new RoleProp();
    prop3.name = "role3";
   
    RoleProp prop4 = new RoleProp();
    prop4.name = "role4";
   
    List<RoleProp> roleProps = new ArrayList<RoleProp>();
    roleProps.add(prop1);
    roleProps.add(prop2);
    roleProps.add(prop3);
    roleProps.add(prop4);
   
    assertTrue(Util.isRolePresent(roleProps, prop1.name));
    assertTrue(Util.isRolePresent(roleProps, prop2.name));
    assertTrue(Util.isRolePresent(roleProps, prop3.name));
    assertTrue(Util.isRolePresent(roleProps, prop4.name));
   
    assertTrue(false == Util.isRolePresent(roleProps, "not present"));   
  }
}
TOP

Related Classes of gwtappcontainer.testhelpers.UtilTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.